Tootsville::Infinity-Set-User-Var

Function

Infinity-Set-User-Var names a function, with lambda list (D USER RECIPIENT/S):

Set “User Variables”

Lisp SET-USER-VAR = JSON setUserVar

Usage

{ "KEY": "VALUE" [ ... ] }

{ d: "D-String" }

{ wtl: course: { COURSE }, facing: FACING }

{ d3: course: { COURSE } }

{ xpr: "expression" }

{ sN: "D-String" }

{ shotN: course: { COURSE }, facing: FACING }

This is a legacy-type method, which is provided for the convenience of client implementors.

Example

{ c: "setUserVar",
  { d: "100~100~200~200~NE~6029604401000",
    s0: "100~100~300~300~NE~6029604401000",
    xpr: "smile" } }

Changes from 1.2 to 2.0

Historically, arbitrary attributes could be attached to a user in the game, as transient values that remained as long as that user was connected. Thus, any key:value pair could be “advertised” by a user by posting them to this method.

Available Attributes (2.0)

In Romance II, only the following “user variable” key names are actually supported:

d
This is the legacy “d” string for purposes of positioning and guiding a character. Since it was designed for a 2-dimensional space, the coördinate space is treated as (x,z) rather than (x,y) if there is no “z” coördinate given. Since Romance II clients are expected to use wtl or d3 packets only, this will be translated into a wtl course and then transmitted.

See TOOTSVILLE INFINITY-WTL for a discussion of its structure.

wtl
See TOOTSVILLE INFINITY-WTL for the structure of this linear course.

d3
This is an experimental format not yet used in Romance 2.0. It will support more complex path descriptions.

xpr
This sets the player's expression (on their face); not yet supported in Tootsville V.

sN

This is a shot position in d form, where N is an arbitrary unique identifier chosen by the client. See TOOTSVILLE INFINITY-SHOOT for another way to provide this data.

shotN

This is a shot position in wtl form, where N is an arbitrary unique identifier chosen by the client.

Any other KEY value will result in an error.

200 OK

When all keys are set successfully, this will return with a packet like

{ from: "setUserVar",
  status: true,
  set: [ "key", ... ] }

When some keys could not be set, they will be listed separately

{ from: "setUserVar",
  status: true,
  set: [ "key", ... ],
  unset: [ "key", ... ] }

400 Illegal

When no key is from the set of supported keys, an error is returned:

{ from: "setUserVar",
  status: false,
  unset: [ "key", ... ] }

File

Defined in file src/infinity/legacy-commands.lisp.